<%@page import="com.bill.common.user.dto.AccountDTO"%>
<%@page import="com.bill.common.user.service.IAccountService"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
if(session.getAttribute("password2")==null){
	response.sendRedirect( "login2.jsp?pageUrl=user/email.jsp");
	return;
}
%>
<fmt:setLocale value="${empty cookie['language'].value?'zh_CN':cookie['language'].value}"/>
	<fmt:setBundle basename="i18n.itilbase"/>
	<c:set var="lang" value="${empty cookie['language'].value?'zh_CN':cookie['language'].value}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="UTF-8">
<title><fmt:message key="i18n.emailManage"/>-<fmt:message key="i18n.title"/>  </title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1" />

<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="scripts/jquery/jquery-1.4.2.min.js"></script>

<script>

$(function(){
	//showTransRecord('tr_recommend_table','tr_recommend_pager','recommend',1,10,'optDate','desc');
	//showDirectPushUser('tr_recommendGrid_table','tr_recommendGrid_pager','${user.loginName}',1,10,'registerTime','desc');
    $("#deleteEmail").click(function(){
    	$("#emailForm").submit();
    });
    
    $("#email_table").find("tr").addClass("color1");
	$("#email_table").find("tr:odd").addClass("color2");
})

</script>
</head>
<body style="height:800px">
<div class="mwCurrent"><p><fmt:message key="i18n.yourlocation"/>：<fmt:message key="i18n.message"/>   &gt;   <fmt:message key="i18n.email"/></p></div>
<!-- 主体内容 -->
<div class="mainWrap">
<div class="listWrap">
	<div class="dl_title">
        <span></span>
        <div class="dltit"><h3><fmt:message key="i18n.email"/></h3></div>
        <strong></strong>
    </div>
    <div class="listCont">
    	<div class="listTable lttno">
    		<table width="100%">
				<tr>
					<td>
					   <a href="email!findEmail.action?emailMessageQueryDto.toUser=${session.loginName}&sord=desc&sidx=sendDate">[<fmt:message key="i18n.toEmail"/>]</a>
					</td>
					<td>
						<a href="email!findEmail.action?emailMessageQueryDto.fromUser=${session.loginName}&sord=desc&sidx=sendDate">[<fmt:message key="i18n.fromEmail"/>]</a>	
					</td>
					<td>
						<a style="cursor: pointer;" id="deleteEmail">[<fmt:message key="i18n.delete"/>]</a>	
				 	</td>
				</tr>
			</table>
			
			
			<table class="mytable" id="email_table">
		   		<thead>
		   			<tr class="color1">
		   				<th><input type="checkbox" id="checkAll"/><fmt:message key="i18n.selectAll"/></th>
		   				<th><fmt:message key="i18n.sendUser"/></th>
		   				<th><fmt:message key="i18n.titleAndContent"/></th>
		   				<th><fmt:message key="i18n.sendDate"/></th>
		   				<th><fmt:message key="i18n.status"/></th>
		   			</tr>
		   			
		   		</thead>
		   		<tbody>
		   			
		   			<c:forEach items="${emailDtos.data}" var="data">
		   				<tr>
		   					<td ><input type="checkbox" name="ids" value="${data.emailMessageId}"></td>
		   					<td>${data.fromUser}</td>
		   					<td>${data.subject}</td>
		   					<td>${data.sendDate}</td>
		   					<td></td>
		   				</tr>
		   			</c:forEach>
		   			
		   			<c:if test="${empty pageDTO.data}">
		   				<tr>
		   					<td colspan="5" align="center"><fmt:message key="i18n.noData"/>!</td>
		   				</tr>
		   			</c:if>
		   			
		   		</tbody>		        		
		   	</table>
			
			<!-- 分页 start -->
			<div class="page">
			<div id="tr_recommendGrid_pager" class="page_r">
				<ul>
					<li><a href="email!findEmail.action?emailMessageQueryDto.toUser=${session.loginName}&sord=desc&sidx=sendDate&page=1"><fmt:message key="i18n.firstPage"/></a></li>
					<c:if test="${emailDtos.page!=1}">
						<li><a href="email!findEmail.action?emailMessageQueryDto.toUser=${session.loginName}&sord=desc&sidx=sendDate&page=${emailDtos.page-1}"><fmt:message key="i18n.upPage"/></a></li>
					</c:if>
					<li><a>${emailDtos.page}/${emailDtos.total}</a></li>
					<c:if test="${emailDtos.page+1<=emailDtos.total}">
						<li><a href="email!findEmail.action?emailMessageQueryDto.toUser=${session.loginName}&sord=desc&sidx=sendDate&page=${emailDtos.page+1}"><fmt:message key="i18n.nextPage"/></a></li>
					</c:if>
					<li><a href="email!findEmail.action?emailMessageQueryDto.toUser=${session.loginName}&sord=desc&sidx=sendDate&page=${emailDtos.total}"><fmt:message key="i18n.endPage"/></a></li>
					<li><a><fmt:message key="i18n.total"/>${pageDTO.totalSize}<fmt:message key="i18n.tiao"/></a></li>
				</ul>
			</div>
			</div>
			<!-- 分页 end  -->
			
			
    	</div>
    </div>	

		        	
</div></div>
<jsp:include page="bottom.jsp"></jsp:include>
</body>
</html>